/*
 * Author Peter Mosher
 */
package model;

import java.io.Serializable;


	/**
	 * Creates behavior for User objects. Created as 
	 * rules for all users to follow, but you can't make
	 * a User type.
	 * @author Peter Mosher
	 *
	 */
	public abstract class User implements Serializable  {
	/**
	 * The Constant serialVersionUID.
	 */
	private static final long serialVersionUID = 
		3774441022266105062L;
	/**
	 * First Name of the User.
	 */
	private String myFirstName;
	/**
	 * LastName of the User.
	 */
	private String myLastName;
	/**
	 * Password of the user.
	 */
	private String myPassword;
	/**
	 * Phone Number of the User.
	 */
	private String myPhoneNumber;
	/**
	 * Date of Birth of the User.
	 */
	private String myDOB;
	/**
	 * Email of the user.
	 */
	private String myEmail;
	/**
	 * Username of the user.
	 */
	private String myUserName;

	/**
	 * Creates an empty User object.
	 */
	public User() {}

	/**
	 * Creates a User object (structure that all other
	 * users follow).
	 * @param first first name.
	 * @param last last name.
	 * @param pass password.
	 * @param phone phone number.
	 * @param dob date of birth.
	 * @param email email.
	 * @param userName username.
	 */
	public User(final String first,
			final String last,
			final String pass,
			final String phone,
			final String dob,
			final String email,
			final String userName)
	{
		myFirstName = first;
		myLastName = last;
		myPassword = pass;
		myPhoneNumber = phone;
		myDOB = dob;
		myEmail = email;
		myUserName = userName;
	}
	
	/**
	 * Enumeration of the user types.
	 *
	 */
	public enum UserTypes
	{
		Scheduler,
		LMA,
		Volunteer,
		Unregistered;
	}
	
	/**
	 * Changes the first name of this user.
	 * @param theName this user's new name.
	 */
	public void setFirstName(final String theName)
	{
		myFirstName = theName;
	}
	
	/**
	 * Changes the last name of this user.
	 * @param theName this user's new last name.
	 */
	public void setLastName(final String theName)
	{
		myLastName = theName;
	}
	
	/**
	 * Changes the password of this user.
	 * @param thePassword this user's new password.
	 */
	public void setPassword(final String thePassword)
	{
		myPassword = thePassword;
	}
	
	/**
	 * Changes the Phone Number of this user.
	 * @param thePhoneNumber this user's new phone number.
	 */
	public void setPhoneNumber(final String thePhoneNumber)
	{
		myPhoneNumber = thePhoneNumber;
	}
	
	/**
	 * Changes the Date of Birth of the Current User.
	 * @param theDOB the new date of birth of the current 
	 * user.
	 */
	public void setDOB(final String theDOB)
	{
		myDOB = theDOB;
	}
	
	/**
	 * Changes the email of this user.
	 * @param theEmail this user's new email.
	 */
	public void setEmail(final String theEmail)
	{
		myEmail = theEmail;
	}
	
	/**
	 * Gets this user's user name.
	 * @return this user's user name.
	 */
	public String getUserName() {
		return myUserName;
	}
	
	/**
	 * Gets this user's first name.
	 * @return this user's first name.
	 */
	public String getFirstName()
	{
		return myFirstName;
	}
	
	/**
	 * Gets this user's last name.
	 * @return this user's last name.
	 */
	public String getLastName()
	{
		return myLastName;
	}
	
	/**
	 * Gets this user's password.
	 * @return return this user's password.
	 */
	public String getPassword()
	{
		return myPassword;
	}
	
	/**
	 * Gets this user's phone number.
	 * @return returns this user's phone number.
	 */
	public String getPhoneNumber()
	{
		return myPhoneNumber;
	}
	
	/**
	 * Gets this user's date of Birth.
	 * @return returns this user's date of birth.
	 */
	public String getDOB()
	{
		return myDOB;
	}
	
	/**
	 * Gets this user's email.
	 * @return returns this user's email.
	 */
	public String getEmail()
	{
		return myEmail;
	}
	
	/**
	 * Makes sure that this user's password is valid.
	 * @param thePassword the password entered, that we are
	 * comparing to the actual password.
	 * @return returns true if the password is valid.
	 */
	public boolean authenticate(final String thePassword)
	{
		return myPassword.equals(thePassword);
	}
}
